package com.ck.dao;

import com.ck.model.common.DepartmentUser;
import org.apache.ibatis.annotations.*;

public interface DepartmentUserMapper {
    @Delete({
        "delete from ck_department_user",
        "where department_user_id = #{departmentUserId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long departmentUserId);

    @Insert({
        "insert into ck_department_user (department_user_id, department_id, ",
        "user_id)",
        "values (#{departmentUserId,jdbcType=BIGINT}, #{departmentId,jdbcType=BIGINT}, ",
        "#{userId,jdbcType=BIGINT})"
    })
    int insert(DepartmentUser record);

    int insertSelective(DepartmentUser record);

    @Select({
        "select",
        "department_user_id, department_id, user_id",
        "from ck_department_user",
        "where department_user_id = #{departmentUserId,jdbcType=BIGINT}"
    })
    DepartmentUser selectByPrimaryKey(Long departmentUserId);

    int updateByPrimaryKeySelective(DepartmentUser record);

    @Update({
        "update ck_department_user",
        "set department_id = #{departmentId,jdbcType=BIGINT},",
          "user_id = #{userId,jdbcType=BIGINT}",
        "where department_user_id = #{departmentUserId,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DepartmentUser record);
}